another blog

Icon

About Microsoft Dynamics GP :-)

Dexterity Can Wait and Respond.

https://evspakistan.wordpress.com/microsoft-dexterity-can-wait-respond/

Filed under: Can i, Dexterity Development, Dynamics GP, dynamics-gp, Uncategorized, , ,

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, , , ,

Don’t do Ctrl+S (Save Source)

If you are a dexterity developer then avoid using Ctrl+S. Sometimes it happened we start scripting and when try to compile the code got message
of unknown identifier and usually do Ctrl+S, then add the missing identifiers (filed,table etc) and forget to compile the script. So script is there but not compiled. IMHO whole dictionary should be complied before creating a chunk for deployment otherwise below error will occur.

“FP: Script not found errors”.

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

Categories

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.

almas

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

Blog Stats

  • 8,101 hits

RSS dynamics-gp

  • VSTools and database triggers.
    In SanScript coding we have database triggers, Below is a detail of what database triggers are as explained in dexterity manuals. Database triggers Database triggers are activated by successful table operations, such as a record begin read, saved, or deleted. The procedure that runs in response to a database trigger has access to the same […]
    Almas
  • Getting the current active window in Dexterity.
    Using dexterity there is not a direct way of getting current active window information, but with set of available GP functions and triggers can make this task happen. Below I am sharing a trigger and function which can tell the active window name. Below code needs to be changed according to the needs of developer, […]
    Almas
  • Hints and Tips… On going Post
    This is on going post and points will be added from time to time. 🙂 .. with Field Level Security we can not restrict document access on Sales transaction entry Window. Means we can not make user to choose only ‘Invoices’ in SOP Type drop down. .. we can not add custom table in table […]
    Almas
  • Reversing the sort order of Receivable Transaction Inquiry – Customer by Document Date
    Last few months we got more request on changing sort orders of Inquiry windows and lookups and to cover them all in a one place I have been working on a small project which will provide a simple sorting without much effort. In Dynamics Community there was a post having similar situation, I have already […]
    Almas
  • Getting the current open window in .net GP Add In
    There are many ways of getting information of active window in GP, but it changes according to the developing tool we are working on. 1.Dexterity.(the best tool 🙂
    Almas
  • Not all RW_Function are meant for reports.
    There are lots of RW functions available in a report writer Calculated Field Definition window and almost all of them are so handy while working on report writer, but it is a matter of fact that some of them are not actually meant for report writer. Usually RW functions are associated with report writer and […]
    Almas
  • Dexterity Can Wait and Respond.
    https://evspakistan.wordpress.com/microsoft-dexterity-can-wait-respond/Filed under: Can i, Dexterity Development, Dynamics GP, dynamics-gp, Uncategorized Tagged: Delay, dexterity, Wait
    Almas
  • Cross Dictionary Development.
    https://evspakistan.wordpress.com/cross-dictionary-development/    Filed under: Dexterity Development, Dexterity Triggers, Dynamics GP, dynamics-gp, Uncategorized
    Almas
  • Calling Sales Document Numbers Lookup
    Often developers need to open available lookup on their custom form from dynamics GP.Sales Document Number lookup is a very common and much used lookup and every dynamics technical person needs to call it in once (or more) in their lifetime. 🙂 Dynamics GP SDK provide a prototype of coding on how to open various […]
    Almas
  • This datatype name is already in use.
    This datatype name is already in use.
    Almas
Coding Notes

Code, News, Tech & Stuff

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.

%d bloggers like this: