strFind (Find a first occurrence of a character in a string)
info("int strFind(str _text,str _characters,int _position,int _number)");
info("Searches a text string for the first occurrence of one of the specified characters.");
info("_text- The text string to search.");
info("_characters - The characters to search for.");
info("_position - The position in the text string where the search begins.");
info("_number - The number of characters to search.");
info("strFind(\"ABCDEFGHIJ\",\"C\",1,10) " + int2str(strFind("ABCDEFGHIJ","C",1,strLen("ABCDEFGHIJ"))));
info("strFind(\"ABCDEFGHIJ\",\"C\",10,-10) " + int2str(strFind("ABCDEFGHIJ","C",strLen("ABCDEFGHIJ"),(-1) * strLen("ABCDEFGHIJ"))));
To Cancel Deliver Remainder through X++ you can use below code sample. Thanks. static void _CancelDeliverRemainder_Sales(Args _args) { SalesLine SalesLine = SalesLine::find('SO0013', true); ; if (SalesLine) { // Set remaining inventory Qty to zero SalesLine.RemainInventPhysical = 0; // Set remaining physical Qty to zero SalesLine.RemainSalesPhysical = 0; // We have to cancel the SalesLine SalesLine.PurchStatus = PurchStatus::Canceled; SalesLine.update(); ...