another blog

Icon

About Microsoft Dynamics GP :-)

Saving attachments by using batch file and sanscript code.

Dynamics GP 2013 is providing attachments for several windows. That’s nice to see it. 🙂

I had similar customization for Sales Transaction Entry window for multiple attachments of different type, image file, document file or text file. The attachment icons will be visible if sales order have attachments and will also be available even when orders get transferred into Invoice. For this customization we were saving attachments for sales order from some web pages.

Another window for which we do attachment work is Item Maintenance window. For this purpose we created a setup table for destination path where we save images, user could select image from anywhere and we copy that image to that particular folder so images could be access through other places or web pages.

For this purpose instead of creating any exe or .net project we use sanscript functions and batch programming.Sharing a code here.

Image

On browse button we have this code.

Image

Here we are calling a function where we create folder for respective item on destination path and then create a batch file to copy image file from source to destination path and afterwards delete the batch file.

function returns nothing;
in string i,ip;
out string ap4;

local string drive,p,l_Pathname,l_Returned_String,rString,a,b;
local boolean result,l_File_Error,l_Result,l_result;
local AttachmentPath ap, ap2,ap3;
local integer l_file_ID;

if empty(i) then
abort script;
end if;

if empty(ip) then
abort script;
end if;

‘Setup Key’ of table DestinationAttachmentPath=1;
get table  DestinationAttachmentPath;
if err()=OKAY then
ap=AttachmentPath of table DestinationAttachmentPath; {where we have to save file}
result = Path_DoesExist(AttachmentPath of table DestinationAttachmentPath);
end if;

if result= false then
ask(“Image destination path not setup.”,”OK”,””,””);
abort script;
end if;

drive=substring(ap,1,1);
drive=drive+”:”;

{create folder for item number}
Path_CreateFolder(ap+”\”+i);
result = Path_DoesExist(ap+”\”+i);
if result=false then
ask( “Folder for item “+i+” not created.”,”OK”,””,””);
abort script;
end if;

ap2=ap+”\”+i+”\”+i+”.bat”;
ap3=ap+”\”+i+”\”;

l_file_ID = TextFile_Open(ap2, 0, 2);
TextFile_WriteLine(l_file_ID,”set ver1=”+DoubleQ+ap3+DoubleQ);
TextFile_WriteLine(l_file_ID,”set ver2=”+DoubleQ+ip+DoubleQ);
{TextFile_WriteLine(l_file_ID,”E:”); {need to set drive here}}
TextFile_WriteLine(l_file_ID,drive);
TextFile_WriteLine(l_file_ID,”cd %ver1%”);
TextFile_WriteLine(l_file_ID,”copy %ver2%”);
TextFile_WriteLine(l_file_ID,”del “+DoubleQ+ap2+DoubleQ);
result=TextFile_Close(l_file_ID);
if result=false then
TextFile_Close(l_file_ID);
end if;

run application ap2,””;

Image

Image

Filed under: Dexterity Development, Dynamics GP, dynamics-gp, , , ,

Posted receipts not showing on Enter Match Invoice window

Issue: Posted receipts not showing on Enter Match Invoice window, even record exist can be verify at backend.

Cause:  Posting interrupted or everything is possible in the world of dynamics GP.

Fix: Update two fields in two different PO tables.

  1. POP_POLine

Display Name        Purchase Order Line

O/S Name               POP10110

Update PO Line status field. For posted lines it should be set as 4. Use as many ”wheres” as you can so update the right record.

4 = POP_POLINESTATUS_RECEIVED

/*update POP10110 set POLNESTA=4

Where  PONUMBER=’POXXXXXXXX’ and ITEMNMBR=’XXXXXXXXXX’

and ORD=’XXXXXXX’ and VENDORID=’XXXXXX’*/

  1. POP_PORcptApply

Display Name        Purchasing Receipt Line Quantities

O/S Name               POP10500

The POP_PORcptApply table contains the information necessary to apply a POP_ReceiptLine to its POP_POLine.

Update Status field. It should be 1.

1= Posted

/*update POP10500 set Status=1 where PONUMBER=’POXXXXXXXXXX’

And  POPRCTNM=’RCTXXXXX’ and POLNENUM=’XXXXXX’

and  ITEMNMBR=’XXXXXXXX’*/

http://www.facebook.com/notes/almas-mahfooz/posted-receipts-not-showing-on-enter-match-invoice-window/405639859506815

Filed under: Data Issue of Dynamics GP, , , ,

Enter your email address to follow this blog and receive notifications of new posts by email.

Enter your email address to follow this blog and receive notifications of new posts by email.

3rd party database access 3180 adding CR in text field Adding NULL values in dropdown Adding Sample Company Data Adding Symbol to Currency fields Alternate Window Analytical Accounting Attachments cancel button Can I ... Carriage Return chunk CH_SPACE CMMTTEXT Cross Dictionary Dexterity Development Cross Dictionary Triggers Currency Symbol in Dynamics GP windows Damo Data for Dynamics sample company Datatype dex DEX.DIC dexterity Dexterity Currency field Dexterity Dropdown Dexterity finditem() Dexterity Triggers DEX_ROW_TS Dict_GetPathname() Dynamics GP Dynamics GP Posting Issues Finding GP Field finding specific field in tables Finding Table Focus Trigger FP: Script not found errors GETUTCDATE() great plains Grid How to identified product related to error. hyperspace Hyperspace property of dexterity field. Increasing Field Size of Dynamics GP Table INFORMATION_SCHEMA.COLUMNS Link Format Selector Microsoft Dynamics Error Modified Reports Modifier MOP_Order_MSTR Path_MakeNative() Path_SelectPathname() Posted receipts not showing on Enter Match Invoice window.Enter Match Invoice window. Project Accounting For Dynamics GP Reading Folder Redisplay Refill Report Destination Sales Transaction Entry Scroll Sanscript Saving Images Script Error Script Not Found Session access denied SmartList Favourites SQL Script to Find column in tables SQL_Execute SUSER_SNAME() TextFile_ReadLine() TextFile_WriteLine() The SELECT permission was denied on the object "XXX" transaction entry User access Using SQL in Dexterity VBA for Dynamics GP You may not edit this document . it is being edited by another user.

Enter your email address to follow this blog and receive notifications of new posts by email.

Freddys blog

Learn something new... - then Teach someone!

حلقۂ دام خیال

عالم تمام حلقۂ دام خیال ہے

M@ria

~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*

Ghostriver Studios Blog

Sculptural stained glass of Andrew Kosorok

Dynamics GP Builders & Reporting

How to use MS Dynamics SmartList Builder, Excel Report Builder and other Reporting tools to get the data and analysis you need.