Wednesday 6 May 2020

BP error 'parameter not used' d365 AX

BP error 'parameter not used' d365 AX 

Add the below text at the end with comma
,SuppressBPWarning('BPParameterNotUsed', "Parameter required"  - to end of the decorator.

E.g.
   [FormDataFieldEventHandler(formDataFieldStr(aForm, aDatasource, aField), FormDataFieldEventType::Validating),SuppressBPWarning('BPParameterNotUsed', "Parameter required")
]

Store value in Container and use it in AX D365 vikas mehta

STORE VALUE IN CONTAINER AND USE IT IN ax 2012 D365

container conNote;
int i,k;
while select  table where table.field == 'abc'
{
                   
    if(confind(conNote, table.description) == 0)
    {
        i++;
        conNote = conIns(conNote, i, table. description);
    }
}

 for (int j=1; j <= conlen(conNote); j++)
 {
              noteDescription = noteDescription + "," + conpeek(conNote, j);
info(conPeek(conNote,j));
}
   Info(strfmt("%1",noteDescription));
  if(noteDescription)
   {
                 Description = strDel(noteDescription,1,1) + " " + Table.Description;
   }
   Info(strfmt("%1",Table.Description));

Condel function is used to remove the value from container.

Container =conDel(Container,2,1);

conNull function is used to clear all the value from container as

Container=conNull() ;

Thanks,
vikas Mehta.

Tuesday 5 May 2020

remove first characters in D365 ax 2012 X++ code

X++ CODE TO REMOVE first or starting CHARACTERS.

use the below code to remove the last character of a string in ax .

strDel(noteDescription,1,1)

str strDel(
    str _text,
    int _position,
    int _number)

Example:

using strDel function Note: removes 2 letters from 4th letter onwards

info(strDel("1Description",1,1));

Result : Description

Similarly the number of characters can be increased or descreased.
Below code will remove the last 3 characters from the string.
Str example = 'Example123';
info(strDel(example, strLen(example) -2, 3));

Output : 'Example'

Thanks,
Vikas Mehta.


AZURE INTERVIEW QUESTIONS AND ANSWERS

AZURE INTERVIEW QUESTIONS AND ANSWERES 2021 2. What is cloud computing? Explanation:  It is the use of servers on the internet to “store...