In a Report it gets the position reference and currently it doesn't allow for entries over 250 characters. I'm trying to change this to allow for no size restriction. How can I change this code to remove the restriction. I know it's involving the MAXSTRLEN is it that alone I need to remove or anything else.
The return value in the function is set to text and No Size entered.
//TIO000007 - Return a comma delimited list of position references
recProdOrderPositionRefs.RESET;
recProdOrderPositionRefs.SETCURRENTKEY(
"Position Order Alpha",
"Position Order Numeric",
"Position Order Suffix"
);
// check if the position refs have been created for the work order
recProdOrderPositionRefs.SETRANGE("Prod. Order No.", "Prod. Order No.");
recProdOrderPositionRefs.SETRANGE("Prod. Order Line No.", "Prod. Order Line No.");
IF NOT recProdOrderPositionRefs.ISEMPTY THEN BEGIN
recProdOrderPositionRefs.SETRANGE("Item No.", "Item No.");
CASE optNotFittedFilter OF
optNotFittedFilter::Yes: recProdOrderPositionRefs.SETRANGE("Not Fitted", TRUE);
optNotFittedFilter::No: recProdOrderPositionRefs.SETRANGE("Not Fitted", FALSE);
optNotFittedFilter::Both: recProdOrderPositionRefs.SETRANGE("Not Fitted");
END;
IF recProdOrderPositionRefs.FINDSET THEN REPEAT
IF strReferences = '' THEN
strReferences :=
recProdOrderPositionRefs."Position Reference"
ELSE IF STRLEN(
strReferences +
',' +
recProdOrderPositionRefs."Position Reference"
) <= MAXSTRLEN(strReferences) THEN
strReferences :=
strReferences +
',' +
recProdOrderPositionRefs."Position Reference"
ELSE
strReferences :=
COPYSTR(
strReferences,
1,
STRLEN(strReferences)-3)
+ '...';
UNTIL recProdOrderPositionRefs.NEXT = 0
END ELSE BEGIN
// else return the references from the BOM
recProductionBOMLine.RESET;
recProductionBOMLine.SETRANGE("Production BOM No.", "Production BOM No.");
recProductionBOMLine.SETRANGE("Version Code", "Production BOM Version Code");
recProductionBOMLine.SETRANGE("Line No.", "Production BOM Line No.");
recProductionBOMLine.SETRANGE("No.", "Item No.");
IF NOT recProductionBOMLine.ISEMPTY THEN
IF recProductionBOMLine.FINDFIRST THEN
strReferences := recProductionBOMLine.PositionReferences(optNotFittedFilter);
END;
EXIT(strReferences);
ProdOrderPositionRefsNew(optNotFittedFilter : 'Yes,No,Both') : Text
//TIO000007 - Return a comma delimited list of position references
recProdOrderPositionRefs.RESET;
recProdOrderPositionRefs.SETCURRENTKEY(
"Position Order Alpha",
"Position Order Numeric",
"Position Order Suffix"
);
// check if the position refs have been created for the work order
recProdOrderPositionRefs.SETRANGE("Prod. Order No.", "Prod. Order No.");
recProdOrderPositionRefs.SETRANGE("Prod. Order Line No.", "Prod. Order Line No.");
IF NOT recProdOrderPositionRefs.ISEMPTY THEN BEGIN
recProdOrderPositionRefs.SETRANGE("Item No.", "Item No.");
CASE optNotFittedFilter OF
optNotFittedFilter::Yes: recProdOrderPositionRefs.SETRANGE("Not Fitted", TRUE);
optNotFittedFilter::No: recProdOrderPositionRefs.SETRANGE("Not Fitted", FALSE);
optNotFittedFilter::Both: recProdOrderPositionRefs.SETRANGE("Not Fitted");
END;
IF recProdOrderPositionRefs.FINDSET THEN REPEAT
IF strReferences = '' THEN
strReferences :=
recProdOrderPositionRefs."Position Reference"
{ ELSE IF STRLEN(
strReferences +
',' +
recProdOrderPositionRefs."Position Reference"
) <= MAXSTRLEN(strReferences) THEN
strReferences :=
strReferences +
',' +
recProdOrderPositionRefs."Position Reference" }
ELSE
strReferences :=
COPYSTR(
strReferences,
1,
STRLEN(strReferences)-3)
+ '...';
UNTIL recProdOrderPositionRefs.NEXT = 0
END ELSE BEGIN
// else return the references from the BOM
recProductionBOMLine.RESET;
recProductionBOMLine.SETRANGE("Production BOM No.", "Production BOM No.");
recProductionBOMLine.SETRANGE("Version Code", "Production BOM Version Code");
recProductionBOMLine.SETRANGE("Line No.", "Production BOM Line No.");
recProductionBOMLine.SETRANGE("No.", "Item No.");
IF NOT recProductionBOMLine.ISEMPTY THEN
IF recProductionBOMLine.FINDFIRST THEN
strReferences := recProductionBOMLine.PositionReferences(optNotFittedFilter);
END;
EXIT(strReferences);
*This post is locked for comments